<?php

namespace App\Http\Controllers;

use App\Http\Requests\CashbookRequest;
use App\Models\Cashbook as Model;
use Iamxcd\LaravelCRUD\Traits\HasCrud;
use Illuminate\Support\Facades\Auth;

class CashbookController extends Controller
{
    use HasCrud;

    public function __construct(Model $model)
    {
        $this->model = $model;
        $this->request = app(CashbookRequest::class);
    }

    /**
     * 获取我的账本列表
     */
    public function appIndex()
    {
        $user = Auth::user();
        $cashbooks =  $user->cashbooks()->get();

        return $this->response([]);
    }
}
